package com.yyge.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yyge.controller.front.merchandiser.req.MerchandiserReq;
import com.yyge.controller.front.merchandiser.resp.MerchandiserResp;
import com.yyge.entity.Merchandiser;
import com.yyge.mapper.MerchandiserMapper;
import com.yyge.service.MerchandiserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【merchandiser(商家信息)】的数据库操作Service实现
* @createDate 2023-07-02 20:36:22
*/
@Service
public class MerchandiserServiceImpl extends ServiceImpl<MerchandiserMapper, Merchandiser>
    implements MerchandiserService{
    @Autowired
    MerchandiserMapper merchandiserMapper;

    @Override
    public PageInfo<MerchandiserResp> frontSearch(MerchandiserReq req) {
        System.out.println("就看看有没有");
        System.out.println(req);
        return PageHelper.startPage(req.getPage(),req.getSize())
                .doSelectPageInfo(()-> {
                    merchandiserMapper.frontSearch(req);
                });
    }

    @Override
    public MerchandiserResp findById(MerchandiserReq req) {
        System.out.println("准备查询的内容...");
        System.out.println(req);
        MerchandiserResp resp = merchandiserMapper.findById(req);
        System.out.println("看看查询结果吧....");
        System.out.println(resp);
        return resp;
    }
}




